<template>
  <view class="check-box">
    <view :class="`item ${itm.value === useDefVal && 'active'}`" v-for="(itm, idx) in props.list" :key="idx"
      @click.stop="emitMsg(itm)">
      <view class="check-radio"></view>
      <view class="check-lab">{{ itm.label }}</view>
    </view>
  </view>
</template>

<script setup>
import { useValue } from "@/path/hooks/v-model"
// const _list = [
//   { value: 1, label: "保养" },
//   { value: 2, label: "保修" }
// ]
// const _value = 1
const emit = defineEmits(['update:value'])
const props = defineProps(["list", "value"])
const { useDefVal } = useValue(props, emit)

const emitMsg = (itm) => {
  useDefVal.value = itm.value
}
</script>

<style lang="less" scoped>
@import url("./index.less");
</style>
